<template>
	<view class="components tn-safe-area-inset-bottom">
		<!-- 顶部自定义导航 -->
		<tn-nav-bar fixed alpha customBack>
			<view slot="back" class='tn-custom-nav-bar__back' @click="goBack">
				<text class='icon tn-icon-left'></text>
				<text class='icon tn-icon-home-capsule-fill'></text>
			</view>
		</tn-nav-bar>
<!-- 		<view class="top-backgroup">
			<image src='http://qiniucloud.qqdeveloper.com//2e70a012f23807e8fdd77d50e27e3978.jpg' mode='widthFix' class='backgroud-image'>
			</image>
		</view> -->

		<view class="nav_title--wrap tn-margin-bottom-sm ai-category">
			<view class="nav_title tn-cool-bg-color-15"></view>
		</view>
		<view class='nav-list'>
			<block v-for="(content_item, content_index) in navList" :key="content_index">
				<view hover-class='none' @click="clickMenu(content_item)"
					class="nav-list-item tn-shadow-blur tn-cool-bg-image tn-flex tn-flex-col-center tn-flex-row-between" :style="'background-color:'+content_item.bg+' !important;'">
					<view class="nav-link tn-flex-1">
						<view class='title'>{{ content_item.title }}</view>
					</view>
					<view class="icon">
						<view style="width: 100%; height: 100%;"><image :src="content_item.url + content_item.path" style="width: 100%; height: 100%;"></image></view>
					</view>
				</view>
			</block>
		</view>

		<view class="tn-padding-bottom-xs"></view>

	</view>
</template>

<script>
	import { imageSubjectCategory } from '@/utils/api/image'
	import template_page_mixin from '@/libs/mixin/template_page_mixin.js'
	export default {
		name: 'ImageCategory',
		mixins: [template_page_mixin],
		data() {
			return {
				navList: []
			}
		},
		created() {
			this.getAiAppList()
		},
		methods: {
			clickMenu(item) {
				uni.navigateTo({
					url: "/pageA/wallpaper/wallpaper?subject_uid=" + item.uid
				})
			},
			getAiAppList() {
				imageSubjectCategory({}).then(res => {
					this.navList = res
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	@import "@/scss/tool_card_list.scss"
</style>